{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">编辑文件下载</h3>
	<table class="layui-table layui-table-form">
		<tr><td class="layui-td-gray-2">文件名<font>*</font></td>
			<td><input type="text" name="filename"  lay-verify="required" lay-reqText="请完善文件名" value="{$detail.filename}" autocomplete="off" placeholder="请输入文件名" class="layui-input"></td><td class="layui-td-gray-2">文件路径+文件名<font>*</font></td>
			<td><input type="text" name="filepath"  lay-verify="required" lay-reqText="请完善文件路径+文件名" value="{$detail.filepath}" autocomplete="off" placeholder="请输入文件路径+文件名" class="layui-input"></td><td class="layui-td-gray-2">文件后缀<font>*</font></td>
			<td><input type="text" name="fileext"  lay-verify="required" lay-reqText="请完善文件后缀" value="{$detail.fileext}" autocomplete="off" placeholder="请输入文件后缀" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">文件类型</td>
			<td><input type="text" name="mimetype"  value="{$detail.mimetype}" autocomplete="off" placeholder="请输入文件类型" class="layui-input"></td><td class="layui-td-gray-2">0未审核1已审核-1不通过</td>
			<td><input type="text" name="status"  value="{$detail.status}" autocomplete="off" placeholder="请输入0未审核1已审核-1不通过" class="layui-input"></td><td class="layui-td-gray-2">创建时间</td>
			<td><input type="text" name="create_time"  value="{$detail.create_time}" autocomplete="off" placeholder="请输入创建时间" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">删除时间</td>
			<td><input type="text" name="delete_time"  value="{$detail.delete_time}" autocomplete="off" placeholder="请输入删除时间" class="layui-input"></td><td class="layui-td-gray-2">来源模块功能</td>
			<td><input type="text" name="action"  value="{$detail.action}" autocomplete="off" placeholder="请输入来源模块功能" class="layui-input"></td><td class="layui-td-gray-2">下载量</td>
			<td><input type="text" name="download"  value="{$detail.download}" autocomplete="off" placeholder="请输入下载量" class="layui-input"></td>
		</tr>
				
	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$detail.id}"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/file_download/edit", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->